# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"
inherit eutils

DESCRIPTION="FRAMA-C"
HOMEPAGE="http://frama-c.cea.fr/"
MY_P=${PN}-Beryllium-${PV}
SRC_URI="http://frama-c.cea.fr/download/${MY_P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="gui syntactic_callgraph"
DEPEND="
	>=sys-devel/make-3.81
	>=dev-lang/ocaml-3.10.2
	>=x11-libs/gtk+-2.4
	gui? ( =dev-ml/lablgtk-2.12.0[sourceview] )
	syntactic_callgraph? ( >=dev-ml/lablgtk-2.12.0[gnomecanvas] )"
RDEPEND="${DEPEND}"

src_compile() {
	cd ${WORKDIR}/${MY_P}
	econf $(use_enable gui) || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	local myconf="\
		BINDIR=${D}usr/bin \
		MANDIR=${D}usr/man \
		FRAMAC_LIBDIR=${D}usr/lib/frama-c \
		FRAMAC_DATADIR=${D}usr/share/frama-c"
	cd ${WORKDIR}/${MY_P}
	make ${myconf} install || die "einstall failed"
}
